1. Technical Field
The present invention relates to processing (calibration) for computing a parameter used to compute a three-dimensional coordinate in order to perform three-dimensional measurement processing in which a set of stereo images is used.
2. Related Art
In order to perform the three-dimensional measurement with a stereo camera, it is necessary to obtain a perspective transformation matrix P in a transformation equation expressing a relationship between a coordinate system of each camera constituting the stereo camera and a world coordinate system (see the following equations (1) and (2)). In the equation (1), λ is a scale factor.
                    [                  Formula          ⁢                                          ⁢          1                ]                                                                      λ          ⁡                      [                                                            x                                                                              y                                                                              1                                                      ]                          =                  P          ⁡                      [                                                            X                                                                              Y                                                                              Z                                                                              1                                                      ]                                              (        1        )                                P        =                  [                                                                      P                  00                                                                              P                  01                                                                              P                  02                                                                              P                  03                                                                                                      P                  10                                                                              P                  11                                                                              P                  12                                                                              P                  13                                                                                                      P                  20                                                                              P                  21                                                                              P                  22                                                                              P                  23                                                              ]                                    (        2        )            
In the perspective transformation matrix P, elements P00, P01, . . . , P23 reflect internal parameters (such as a focal distance, resolution, and an image center) of the camera and parameters (such as a rotation deviation amount between a world coordinate system and a camera coordinate system and a position deviation amount of an origin of each coordinate system) caused by a position and an attitude of the camera. In conventional calibration processing, at least four sets of two-dimensional coordinates (x, y) and three-dimensional coordinates (X, Y, Z) of the camera coordinate system are obtained in each camera, and the coordinates of each set is substituted for the equation (1) to form a simultaneous equation with multiple unknowns in which each element in the matrix P is set to an unknown. The most preferable value of each element is specified by a least square method and the like.
For example, there is disclosed a method for simply deriving the coordinates used to compute the equation (1) (see Technique for Camera Calibration”, Microsoft Research Microsoft Corporation, Feb. 2, 2009, the Internet, URL:http://research.microsoft.com/en-us/um/people/zhang/calib/ and Japanese Unexamined Patent Publication No. 2006-250889). In Technique for Camera Calibration”, Microsoft Research Microsoft Corporation, Feb. 2, 2009, the Internet, URL:http://research.microsoft.com/en-us/um/people/zhang/calib/, a flat-plate workpiece in which a two-dimensional calibration pattern constituting marks arrayed at equal intervals are provided is imaged at least twice while a height and an orientation of the workpiece are changed, a feature point corresponding to each mark is extracted from each image produced by the imaging, and the coordinate of the world coordinate system is specified from a relationship among the feature points.
In the method of Japanese Unexamined Patent Publication No. 2006-250889, transparent sheets in which different calibration patterns are provided are imaged while disposed on the level with a predetermined interval, whereby a number of feature points necessary for the calibration pattern can be obtained by one-time imaging.
The inventor notices the following problem in the development of the general-purpose three-dimensional visual sensor.
In the calibration processing for obtaining the three-dimensional measurement parameter, the setting of the simultaneous equation with multiple unknowns and the computation for solving the unknown are automatically performed with a computer, while a user performs work for placing a calibration pattern in a space. Accordingly, when the calibration pattern is improperly disposed with respect to the camera, or when a jig in which the pattern is formed becomes dirty, the parameter cannot be computed with high accuracy, which results in a problem in that the accuracy of three-dimensional measurement is lowered.
Therefore, after the parameter is set, preferably a confirmation whether or not the parameter is proper is made by test measurement with a model whose three-dimensional shape is well known. However, in such cases, unfortunately it is necessary to image the model and it is necessary to previously obtain the correct three-dimensional information.
Particularly a user who uses a visual sensor in applications (for example, processing for detecting a height to determine whether the height is proper) in which the three-dimensional matching processing is not required probably has no pieces of three-dimensional information such as CAD data. Frequently found is a user who performs matching processing performs work for registering the three-dimensional model of a recognition object after the calibration. Possibly the user starts the actual processing without confirming the accuracy of parameter set by the calibration.